﻿using System.Collections.Generic;
using System.Text;

namespace IceDog.Lib.Generic
{
    public class VectorList:List<Vector>
    {
        public VectorList()
        {

        }
        public VectorList(IEnumerable<Vector> initialItems)
        {
            this.AddRange(initialItems);
        }

        public string Sum()
        {
            var sb = new StringBuilder(100);
            var curr = new Vector(0.0D, 0.0D);
            sb.Append("(origin)");
            foreach (Vector vector in this)
            {
                sb.AppendFormat(" + ({0})", vector);
                curr += vector;
            }
            sb.AppendFormat(" = ({0})", curr);
            return sb.ToString();
        }
    }
}
